package com.jpf.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import javax.jms.Session;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.jpf.demo.Goods;
import com.jpf.demo.Page;
import com.jpf.service.GoodsService;
@WebServlet("/QueryGoods.do")
public class QueryGoods extends HttpServlet {
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		HttpSession session = request.getSession();
		session.invalidate();
		response.setContentType("text/html;charset=utf-8");
		request.setCharacterEncoding("utf-8");
		PrintWriter out = response.getWriter();
		response.sendRedirect("ShowList.do");  
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		response.setContentType("text/html;charset=utf-8");
		request.setCharacterEncoding("utf-8");
		PrintWriter out = response.getWriter();
		GoodsService goodsService = new GoodsService();
		String gname = request.getParameter("gname");
		if (gname != null)
		{
			HttpSession session = request.getSession();
			session.setAttribute("gname", gname);
			response.sendRedirect("ShowList.do");
		}
	}
}
